<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    function fn(a, ...rest) {
        console.log(a);
        console.log(rest);
        // console.log(arguments[2]);
    }
    fn(1, 2, 3, 4)
</script>
<script>
    const obj = {
        id: 123,
        age: 20,
        name: "cyrus",
        school: "河北科技大学"
    }

    let obj1 = {
        age: 18,
        ...obj,
        name: "李四"
    }

    console.log(obj1.age); // 20
    console.log(obj1.id); //  123
    console.log(obj1.name); //  

</script>
<script>
    var obj_1 = {
        name: 'zs',
        age: 10,
        object: {
            age: 20
        }
    }
    var obj_2 = {}
    // var obj_2 = JSON.parse(JSON.stringify(obj_1))

    // console.log(obj_1);
    // console.log(obj_2);
    for (key in obj_1) {
        obj_2[key] = obj_1[key]
    }
    obj_1.age = 20
    obj_1.object.age = 30
    console.log(obj_1);
    console.log(obj_2);
    // function fn_6() {
    //     if () {
    //         fn_6()
    //     } else {
    //         return 1
    //     }
    // }
    // fn_6()
</script>

</html>